package com.kikt.custombtndemo.http;

import android.support.annotation.NonNull;

import okhttp3.FormBody;
import okhttp3.RequestBody;

/**
 * Created by kikt on 2016/5/8.
 */
public abstract class PostFormRequest extends PostJsonRequest {
    public PostFormRequest(String url, String body) {
        super(url, body);
    }

    @NonNull
    @Override
    protected RequestBody createBody(String body) {
        FormBody.Builder builder = new FormBody.Builder();
        return builder.add("id", body).build();
    }

    @Override
    protected String encodeBody(String body) {
        return body;
    }
}
